#@adminLayout()

#define main()
<div class="jfa-header-box" id="jfa-header-box">
	<div class="jfa-crumbs" id="jfa-crumbs">
		账户管理
	</div>
	<div class="jfa-search-box"></div>
	#include("/_view/_admin/common/_header_right.html")
</div>

### 内容区域
<div class="jfa-content-box" id="jfa-content-box">
	<div class="jfa-content" id="jfa-content">

		<div class="jfa-toolbar">
			<a class="btn btn-primary btn-sm" href="/admin/account/showAdminList">
				<i class="fa fa-user"></i>
				&nbsp;查看后台账户
			</a>
		</div>

		<div class="jfa-table-box margin-top-30">
			<table class="table table-bordered table-hover margin-bottom-10">
				<thead>
				<tr>
					<th>id</th>
					<th>昵称</th>
					<th>用户名</th>
					<th>注册时间</th>
					<th>锁定</th>
					<th>操作</th>
				</tr>
				</thead>
				<tbody>
				#for(x : accountPage.getList())
				<tr>
					<th scope="row">#(x.id)</th>
					<td>#(x.nickName)</td>
					<td>#(x.userName)</td>
					<td>#date(x.createAt)</td>
					<td>
						#if(x.isStatusReg())
							未激活
						#else
							<input data-id="#(x.id)"
								   #if(x.isStatusReg()) disabled #end
								   #if(x.isStatusLockId()) checked #end

								   type="checkbox" class="mgc-switch mgc-tiny">
						#end
					</td>
					<td class="jfa-operation-button">
						<a href="/admin/account/edit?id=#(x.id)&p=#(accountPage.pageNumber)">
							<i class="fa fa-pencil" title="修改"></i>
						</a>

						<a href="/user/#(x.id)" target="_blank">
							<i class="fa fa-eye" title="查看"></i>
						</a>

						<a data-pjax href="/admin/account/assignRoles?id=#(x.id)">
							<i class="fa fa-user" title="分配角色"></i>
						</a>

					</td>
				</tr>
				#end
				</tbody>
			</table>

			<div>
				#@adminPaginate(accountPage.pageNumber, accountPage.totalPage, "/admin/account?p=")
			</div>
		</div>

	</div><!-- END OF jfa-content -->
</div><!-- END OF jfa-content-box -->

<script type="text/javascript">
	$(document).ready(function() {
		initMagicInput(prepareAction);
	});

	function prepareAction($this, state) {
		return {
			url: state ? "/admin/account/lock" : "/admin/account/unlock",
			data : {
				id: $this.attr("data-id")
			}
		}
	}
</script>
#end

